const Router = require('koa-router');
const FileController = require('../controllers/fileController');
const UploadController = require('../controllers/uploadController');

const router = new Router({ prefix: '/api' });

// 文件相关路由
router.get('/files', FileController.getFiles);
router.post('/folder', FileController.createFolder);
router.delete('/files', FileController.deleteFiles);
router.get('/download', FileController.downloadFile);
router.put('/move', FileController.moveFile);
router.get('/info', FileController.getFileInfo);

// 上传相关路由
router.post('/upload', UploadController.getUploadMiddleware(), UploadController.uploadFiles);

module.exports = router; 